package com.menu.system.service.impl;

import java.util.List;
import com.menu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.menu.system.mapper.MenuCaseMapper;
import com.menu.system.domain.MenuCase;
import com.menu.system.service.IMenuCaseService;

/**
 * 案例分享Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-10
 */
@Service
public class MenuCaseServiceImpl implements IMenuCaseService 
{
    @Autowired
    private MenuCaseMapper menuCaseMapper;

    /**
     * 查询案例分享
     * 
     * @param caseId 案例分享主键
     * @return 案例分享
     */
    @Override
    public MenuCase selectMenuCaseByCaseId(Long caseId)
    {
        return menuCaseMapper.selectMenuCaseByCaseId(caseId);
    }

    /**
     * 查询案例分享列表
     * 
     * @param menuCase 案例分享
     * @return 案例分享
     */
    @Override
    public List<MenuCase> selectMenuCaseList(MenuCase menuCase)
    {
        return menuCaseMapper.selectMenuCaseList(menuCase);
    }

    /**
     * 新增案例分享
     * 
     * @param menuCase 案例分享
     * @return 结果
     */
    @Override
    public int insertMenuCase(MenuCase menuCase)
    {
        menuCase.setCreateTime(DateUtils.getNowDate());
        return menuCaseMapper.insertMenuCase(menuCase);
    }

    /**
     * 修改案例分享
     * 
     * @param menuCase 案例分享
     * @return 结果
     */
    @Override
    public int updateMenuCase(MenuCase menuCase)
    {
        menuCase.setUpdateTime(DateUtils.getNowDate());
        return menuCaseMapper.updateMenuCase(menuCase);
    }

    /**
     * 批量删除案例分享
     * 
     * @param caseIds 需要删除的案例分享主键
     * @return 结果
     */
    @Override
    public int deleteMenuCaseByCaseIds(Long[] caseIds)
    {
        return menuCaseMapper.deleteMenuCaseByCaseIds(caseIds);
    }

    /**
     * 删除案例分享信息
     * 
     * @param caseId 案例分享主键
     * @return 结果
     */
    @Override
    public int deleteMenuCaseByCaseId(Long caseId)
    {
        return menuCaseMapper.deleteMenuCaseByCaseId(caseId);
    }
}
